home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 16 / IOPROG_16.ISO / soft / macaxsdk / macsdk.hqx / ActiveX DR3 SDK / ActiveX SDK / Control Common / CBaseCPClient.h / CBaseCPClient.h
Encoding:
Text File  |  1997-04-30  |  5.9 KB  |  264 lines  |  [TEXT/CWIE]

  1. // =============================================================================
  2. //
  3. // >>> ⌐ 1996-1997 Microsoft Corporation.  All rights reserved. <<<
  4. //
  5. //    This is a mix-in class that provides your control with basic capabilities to
  6. //    connect to the outgoing interface(s) of one or more controls.
  7. //
  8. // =============================================================================
  9.  
  10. #ifndef _H_CBaseCPClient
  11. #define _H_CBaseCPClient
  12.  
  13. //=-----------------------------------------------------------------------------
  14. // class declaration
  15. //=-----------------------------------------------------------------------------
  16.  
  17. /*
  18. !CBaseCPClient();
  19. ªC ----- Provides connection capability to controls
  20.  CBaseCPClient methods
  21.     
  22.     This is a mix-in class that provides your control with basic capabilities to
  23.     connect to the outgoing interface(s) of one or more controls.
  24. */
  25.  
  26.  
  27. class CBaseCPClient
  28. {
  29. public:
  30.     // *** CBaseCPClient methods ***
  31.     CBaseCPClient(void);
  32.     /* ñ1 Constructor
  33.     ** INPUT:
  34.     **        void
  35.     */
  36.  
  37.  
  38.     ~CBaseCPClient(void);
  39.     /* ñ1 Destructor
  40.     ** INPUT:
  41.     **        void
  42.     */
  43.  
  44.     virtual Boolean8    AddInterface(IID inInterfaceID);
  45.     /* ñ1 CBaseCPClient method
  46.     ** INPUT:
  47.     **        IID            the id of the interface to be added
  48.     ** RETURNS:
  49.     **        Boolean8    true - the interface was found
  50.     **                    false - the interface was not found
  51.     **
  52.     ** Add the specified interface to the incoming list. Indicates that this control
  53.     ** wants to connect to all controls with a matching outgoing interface.  If
  54.     ** the interface is not found it is added to the list.
  55.     */
  56.  
  57.  
  58.     virtual Boolean8    AddSource(IID inInterfaceID, const Char8* inName);
  59.     /* ñ1 CBaseCPClient method
  60.     ** INPUT:
  61.     **        IID                the id of the interface whose source is being added
  62.     **        const Char8 *    the name of the interface
  63.     ** RETURNS:
  64.     **        Boolean8        false - source already in the list
  65.     **                                unable to allocate CBaseConnectionInfo class
  66.     **                        true - source successfully added
  67.     **
  68.     ** Add the specified source (control ID and interface) to the incoming list.
  69.     ** Indicates that this control wants to connect to the specified interface
  70.     ** of the specified control. <- should this be container???
  71.     */
  72.  
  73.  
  74.     virtual Boolean8    ConnectComplete(void);
  75.     /* ñ1 CBaseCPClient method
  76.     ** INPUT:
  77.     **        void
  78.     ** RETURNS:
  79.     **        Boolean8    true - all the controls/interfaces have been found
  80.     **                    false - unable to find a control/interface we require
  81.     **
  82.     ** Determine if we found all the controls/interfaces to which we want to connect?
  83.     */
  84.  
  85.  
  86.     virtual void         SetUpConnections(IUnknown* inClient, IContainer* inContainer);
  87.     /* ñ1 CBaseCPClient method
  88.     ** INPUT:
  89.     **        IUnknown *        the client
  90.     **        IContainer *    the container whose controls are being connected to
  91.     ** RETURNS:
  92.     **        void
  93.     **
  94.     ** Search the list of controls in the specified container and connect to the
  95.     ** outgoing interfaces as appropriate.
  96.     */
  97.  
  98.  
  99.     
  100. private:
  101.     Boolean8            AddDesiredSource(IID inInterfaceID, const Char8* inName);
  102.     Uint32                CountOpenConnections(void);
  103.     Boolean8            IsDesiredSource(IID inInterfaceID, const Char8* inName);
  104.     Boolean8            IsFoundSource(IID inInterfaceID, const Char8* inName);
  105.     Boolean8            IsSource(IID inInterfaceID, const Char8* inName);
  106.     void                SetUpControlConnection(IUnknown* inClient, IUnknown* inControl);
  107.     
  108.     LArray*                mDesiredSources;
  109.     LArray*                mFoundSources;
  110.     Boolean8            mClosing;
  111. };
  112.  
  113. /*
  114. !CBaseConnectionInfo();
  115. ªC ----- Say something profound
  116.  CBaseConnectionInfo methods
  117.     
  118. ????    Body of class description
  119. */
  120.  
  121.  
  122. class CBaseConnectionInfo
  123. {
  124. public:
  125.     // *** CBaseConnectionInfo methods ***
  126.     CBaseConnectionInfo(void);
  127.     /* ñ2 Constructor
  128.     ** INPUT:
  129.     **        void
  130.     */
  131.  
  132.  
  133.     CBaseConnectionInfo(IID inInterfaceID, const Char8* inSourceName);
  134.     /* ñ2 Constructor
  135.     ** INPUT:
  136.     **        IID                the interface
  137.     **        const Char8 *    the source name
  138.     */
  139.  
  140.  
  141.     ~CBaseConnectionInfo(void);
  142.     /* ñ2 Destructor
  143.     ** INPUT:
  144.     **        void
  145.     */
  146.  
  147.  
  148.     
  149.     virtual IID                GetInterfaceID(void);
  150.     /* ñ2 CBaseConnectionInfo method
  151.     ** INPUT:
  152.     **        void
  153.     ** RETURNS:
  154.     **        IID        the interface id
  155.     **
  156.     ** Get a copy of the interface id.
  157.     */
  158.  
  159.  
  160.     virtual const Char8*    GetSource(void);
  161.     /* ñ2 CBaseConnectionInfo method
  162.     ** INPUT:
  163.     **        void
  164.     ** RETURNS:
  165.     **        const Char8 *    the source name requested
  166.     **
  167.     ** Get a pointer to the source name.
  168.     */
  169.  
  170.  
  171.     virtual    Boolean8        GetFound(void);
  172.     /* ñ2 CBaseConnectionInfo method
  173.     ** INPUT:
  174.     **        void
  175.     ** RETURNS:
  176.     **        Boolean8    indicates whether ??? has been found
  177.     **
  178.     ** Determine whether ??? has been found.
  179.     */
  180.  
  181.  
  182.     virtual void            SetInterfaceID(IID inInterfaceID);
  183.     /* ñ2 CBaseConnectionInfo method
  184.     ** INPUT:
  185.     **        IID        the interface id to be set
  186.     ** RETURNS:
  187.     **        void
  188.     **
  189.     ** Set the specified interface id.
  190.     */
  191.  
  192.  
  193.     virtual void            SetSource(const Char8* inSource);
  194.     /* ñ2 CBaseConnectionInfo method
  195.     ** INPUT:
  196.     **        const Char8 *    the source name to be set
  197.     ** RETURNS:
  198.     **        void
  199.     **
  200.     ** Create or replace the source name.
  201.     */
  202.  
  203.  
  204.     virtual    void            SetFound(Boolean8 inFound);
  205.     /* ñ2 CBaseConnectionInfo method
  206.     ** INPUT:
  207.     **        Boolean8    the new found value
  208.     ** RETURNS:
  209.     **        void
  210.     **
  211.     ** Set the found member.
  212.     */
  213.  
  214.  
  215.     virtual Boolean8        Connect(IUnknown* inClient, IConnectionPoint* inCP);
  216.     /* ñ2 CBaseConnectionInfo method
  217.     ** INPUT:
  218.     **        IUnknown *            the client to be connected to ???
  219.     **        IConnectionPoint *    
  220.     ** RETURNS:
  221.     **        Boolean8            true - connection succeeded
  222.     **                            false - connection failed
  223.     **
  224.     ** Connect to the specified client ???
  225.     */
  226.  
  227.  
  228.     virtual Boolean8        Disconnect(void);
  229.     /* ñ2 CBaseConnectionInfo method
  230.     ** INPUT:
  231.     **        void
  232.     ** RETURNS:
  233.     **        Boolean8    true - disconnect succeeded
  234.     **
  235.     ** Disconnect from the client ???
  236.     */
  237.  
  238.  
  239.     virtual Boolean8        IsConnected(void);
  240.     /* ñ2 CBaseConnectionInfo method
  241.     ** INPUT:
  242.     **        void
  243.     ** RETURNS:
  244.     **        Boolean8    true - you are connected
  245.     **                    false - you are not connected
  246.     **
  247.     ** Determine whether you are connected to the client or not ???
  248.     */
  249.  
  250.  
  251.     
  252. private:
  253.     void                CommonInit(void);
  254.     
  255.     IID                    mInterfaceID;
  256.     Char8*                mSourceName;
  257.     IConnectionPoint*    mConnectionPoint;
  258.     Uint32                mCookie;
  259.     Boolean8            mFound;
  260.     Boolean8            mConnected;
  261. };
  262.  
  263. #endif // _H_CBaseCPClient
  264.